//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#if _MSC_VER > 1000
#pragma once
#endif

#ifndef __MISC_H__
#define __MISC_H__

#ifdef  __cplusplus
extern "C" {
#endif

#define IOL(_p_)       ( (*(volatile unsigned long * )(_p_)) )

typedef unsigned long u32;

void msleep(unsigned int msec);
void D_Delay(unsigned int uSec);

void SerialOutputString(const char *s);
void SerialOutputHex(const unsigned long h);
void SerialOutputDec(const u32 d);
int serial_poll(void);
int serial_read(void);
int serial_write(int c);

/* convert a string to an u32 value */
int strtou32(const char *str, u32 *value);

#ifdef  __cplusplus
}
#endif

#endif//__MISC_H__
